﻿
<%@ Page Language="C#" Theme="Default" MasterPageFile="~/MasterPages/admin.master" AutoEventWireup="true"  CodeFile="Revenue.aspx.cs" Inherits="Revenue" Title="Revenue List" %>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder2" Runat="Server">Revenue List</asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
		<data:GridViewSearchPanel ID="GridViewSearchPanel1" runat="server" GridViewControlID="GridView1" PersistenceMethod="Session" />
		<br />
		<data:EntityGridView ID="GridView1" runat="server"			
				AutoGenerateColumns="False"					
				OnSelectedIndexChanged="GridView1_SelectedIndexChanged"
				DataSourceID="RevenueDataSource"
				DataKeyNames="Id"
				AllowMultiColumnSorting="false"
				DefaultSortColumnName="" 
				DefaultSortDirection="Ascending"	
				ExcelExportFileName="Export_Revenue.xls"  		
			>
			<Columns>
				<asp:CommandField ShowSelectButton="True" ShowEditButton="True" />				
				<asp:BoundField DataField="OrderNum" HeaderText="Order Num" SortExpression="Order_Num"  />
				<asp:BoundField DataField="OrderDate" DataFormatString="{0:d}" HtmlEncode="False" HeaderText="Order Date" SortExpression="Order_Date"  />
				<data:HyperLinkField HeaderText="Customer Id" DataNavigateUrlFormatString="KhachHangEdit.aspx?KhachHangId={0}" DataNavigateUrlFields="KhachHangId" DataContainer="CustomerIdSource" DataTextField="TenKh" />
				<asp:BoundField DataField="Popular" HeaderText="Popular" SortExpression="Popular"  />
				<asp:BoundField DataField="Deluxe" HeaderText="Deluxe" SortExpression="Deluxe"  />
				<asp:BoundField DataField="Note" HeaderText="Note" SortExpression=""  />
				<asp:BoundField DataField="Year" HeaderText="Year" SortExpression="Year"  />
				<asp:BoundField DataField="Month" HeaderText="Month" SortExpression="Month"  />
				<asp:BoundField DataField="BrandCode" HeaderText="Brand Code" SortExpression="BrandCode"  />
			</Columns>
			<EmptyDataTemplate>
				<b>No Revenue Found!</b>
			</EmptyDataTemplate>
		</data:EntityGridView>
		<br />
		<asp:Button runat="server" ID="btnRevenue" OnClientClick="javascript:location.href='RevenueEdit.aspx'; return false;" Text="Add New"></asp:Button>
		<data:RevenueDataSource ID="RevenueDataSource" runat="server"
			SelectMethod="GetPaged"
			EnablePaging="True"
			EnableSorting="True"
			EnableDeepLoad="True"
			>
			<DeepLoadProperties Method="IncludeChildren" Recursive="False">
	            <Types>
					<data:RevenueProperty Name="KhachHang"/> 
				</Types>
			</DeepLoadProperties>
			<Parameters>
				<data:CustomParameter Name="WhereClause" Value="" ConvertEmptyStringToNull="false" />
				<data:CustomParameter Name="OrderByClause" Value="" ConvertEmptyStringToNull="false" />
				<asp:ControlParameter Name="PageIndex" ControlID="GridView1" PropertyName="PageIndex" Type="Int32" />
				<asp:ControlParameter Name="PageSize" ControlID="GridView1" PropertyName="PageSize" Type="Int32" />
				<data:CustomParameter Name="RecordCount" Value="0" Type="Int32" />
			</Parameters>
		</data:RevenueDataSource>
	    		
</asp:Content>



